package day04;

import java.util.Scanner;

public class HomeWorkDay04 {
    public static void main(String[] args) {
//        1.
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入选择");
        int comman = sc.nextInt();
        switch (comman){
            case 1:
                System.out.println("存款业务");
                break;
            case 2:
                System.out.println("取款业务");
                break;
            case 3:
                System.out.println("查询余额");
                break;
            case 4:
                System.out.println("人工服务");
                break;
            default:
                System.out.println("输入错误请重新输入");
                break;

    }
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入选择的项目");
        int comman1 = sc.nextInt();
        switch (comman1){
            case 1:
                System.out.println("旅游业务");
                break;
            case 2:
                System.out.println("导游业务");
                break;
            case 3:
                System.out.println("住宿余额");
                break;
            case 4:
                System.out.println("餐饮服务");
                break;
            default:
                System.out.println("输入错误请重新输入");
                break;

        }


//        2.
        Scanner sca = new Scanner(System.in);
        int num = (int)(Math.random()*500+1);
//        System.out.println(num);
        System.out.println("开始猜吧");
        int guess = sc.nextInt();
        while (guess!=num){
            if (guess<num){
                System.out.println("小了");
            }else if(guess>num){
                System.out.println("大了");
            }
            System.out.println("猜错了重新猜吧！");
            guess = sc.nextInt();
        }

        System.out.println("猜对了");
        Scanner scann = new Scanner(System.in);
        int num1 = (int)(Math.random()*1000+1);
//        System.out.println(num);
        System.out.println("开始猜吧");
        int guess1 = scann.nextInt();
        while (guess1!=num1){
            if (guess1<num1){
                System.out.println("小了");
            }else if(guess1>num1){
                System.out.println("大了");
            }
            System.out.println("猜错了重新猜吧！");
            guess1 = sc.nextInt();
        }
        System.out.println("猜对了");



        //       3.
        Scanner sc1 = new Scanner(System.in);
        int num2 = (int)(Math.random()*500+1);
        int guess2;
        do {
            System.out.println("猜吧！");
            guess2 = sc1.nextInt();
            if (guess2<num2){
                System.out.println("小了点");
            }else if(guess2>num2){
                System.out.println("大了点");
            }else {
                System.out.println("猜对了");
            }
        }while (guess2!=num2);

        Scanner sc2 = new Scanner(System.in);
        int num3 = (int)(Math.random()*1000+1);
        int guess3;
        do {
            System.out.println("猜吧！");
            guess3 = sc2.nextInt();
            if (guess3<num3){
                System.out.println("小了");
            }else if(guess3>num3){
                System.out.println("大了");
            }else {
                System.out.println("猜对了");
            }
        }while (guess3!=num3);


        //        4.
        for (int i=0;i<5;i++){
            System.out.println("行动时成功的阶梯！！！");
        }
        System.out.println("结束");
        for (int i=1;i<=9;i++){
            System.out.println(i+"*9="+i*9);
        }
        for (int i=1;i<=9;i+=2){
            System.out.println(i+"*9="+i*9);
        }
        for (int i=9;i>=1;i--){
            System.out.println(i+"*9="+i*9);
        }
        Scanner sc3 = new Scanner(System.in);
        System.out.println("输入一个数");
        int num4 = sc3.nextInt();
        int sum = 0;
        for (int i = 0;i<=num4;i++){
            sum+=i;
        }
        System.out.println(sum);

        for (int i=0;i<5;i++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("结束....");
        for (int i=1;i<=9;i++){
            System.out.println(i+"*9="+i*9);
        }
        for (int i=1;i<=9;i+=2){
            System.out.println(i+"*9="+i*9);
        }
        for (int i=9;i>=1;i--){
            System.out.println(i+"*9="+i*9);
        }
        Scanner sc4 = new Scanner(System.in);
        System.out.println("输入一个数");
        int num5 = sc4.nextInt();
        int sum1 = 0;
        for (int i = 0;i<=num5;i++){
            sum1+=i;
        }
        System.out.println(sum1);


}
}
